<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<script src="../../js/Width.js" type="text/javascript" charset="utf-8"></script>
		<link href="../../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../../css/Setting.css" />
		
	</head>

	<body style="background-color: #F4F4F4;">
		<div id="feedback">
			<header class="mui-bar mui-bar-nav">
				<a style="color: #fff;" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
				<h1 class="mui-title" style="color: #fff;">意见反馈</h1>
			</header>
			<div class="content">
				<div class="textarea-wapper margin-top15">
					<div class="mui-input-row padding15">
						<textarea id="textarea" v-model="suggestText"  rows="5" placeholder="请说明一下您遇到的问题…"></textarea>
					</div>
				</div>
				<div class="contact flex-between margin-top15">
					
					<input type="number" v-model="contactWay" placeholder="请输入联系方式" maxlength="11" />
				</div>
				<div class="submit-button" @click="submitClick">
					提交
				</div>
			</div>
		</div>
		<script src="../../js/mui.min.js"></script>
		<script src="../../js/vue.js"></script>
		<script src="../../js/util.js"></script>
		<script src="https://cdn.bootcss.com/fastclick/1.0.6/fastclick.min.js"></script>
		<script type="text/javascript">
			mui.init()
			var feedback = new Vue({
				el:'#feedback',
				data:{
				  suggestText:'',
				  contactWay:''
				},
				methods:{
					submitClick:function(){
						var that = this
						if(that.isPoneAvailable(that.contactWay)){
							that.Suggest(that.suggestText,that.contactWay)
						}else{
							mui.toast('请输入正确的手机号')
						}
						
					 
					},
					isPoneAvailable: function (pone) {  
					   var myreg = /^[1][3,4,5,7,8][0-9]{9}$/;  
					   if (!myreg.test(pone)) {  
					     return false;  
					   } else {  
					     return true;  
					   }  
					 },  
					Suggest:function(suggestText,contactWay){
						mui.post(httpUrl.testUrl+'/api/Suggest/Suggest',{
					  	userID:plus.storage.getItem("userID"),
					  	suggestText,
					  	contactWay,
					  },function(res){
					  	if(res.code===1001){
					  		mui.toast('提交成功')
					  		setTimeout(function(){
					  			mui.back()
					  		},1000)
					  	}
					  })
					}
				}
			})
			mui.plusReady(function() {
				FastClick.attach( document.body );  
			})
			

			
		</script>
	</body>

</html>